:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-50: #eef2ff;
    --accent: #e11d48;
    --dark: #0f172a;
    --slate: #64748b;
    --slate-light: #94a3b8;
    --muted: #64748b;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --success: #16a34a;
    --warning: #b45309;
    --radius: 16px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 4px 6px rgba(15, 23, 42, .05), 0 20px 40px rgba(15, 23, 42, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.site-main { display: block; }

/* ---------- Not installed banner ---------- */
.not-installed {
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}
.not-installed a { color: #dc2626; text-decoration: underline; }

/* ---------- Announcement bar ---------- */
.announcement {
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    color: #fff;
    text-align: center;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .2px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .92);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
}
.brand-mark {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    border-radius: 12px;
    display: grid; place-items: center;
    font-weight: 900; font-size: 17px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
}
.brand-logo {
    width: 42px; height: 42px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16.5px; font-weight: 800; letter-spacing: -.3px; }
.brand-text small { font-size: 11.5px; color: var(--slate); font-weight: 500; }
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate);
    transition: .18s;
    white-space: nowrap;
    flex: 0 0 auto;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-50); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    flex-shrink: 0;
    justify-self: end;
    min-width: 0;
    position: relative;
}
.account-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 200px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--dark);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: .18s;
}
.account-link:hover,
.account-link[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); background: var(--primary-50); }
.account-link .account-caret { flex-shrink: 0; transition: transform .2s ease; opacity: .65; }
.account-link[aria-expanded="true"] .account-caret { transform: rotate(180deg); opacity: 1; }

/* ---------- Account dropdown ---------- */
.account-wrap { position: relative; }
.account-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 248px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.account-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.account-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 22px;
    width: 14px;
    height: 14px;
    background: var(--card);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
}
.account-menu-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 10px 12px;
}
.account-menu-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    overflow: hidden;
}
.account-menu-avatar.guest { background: var(--primary-50); color: var(--primary); }
.account-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu-id { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-menu-name { font-size: 14px; font-weight: 800; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-email { font-size: 12px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--dark);
    font-size: 13.5px;
    font-weight: 600;
    transition: .15s;
}
.account-menu-item:hover { background: var(--primary-50); color: var(--primary); }
.account-menu-ico { font-size: 15px; line-height: 1; width: 18px; text-align: center; }
.account-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.account-menu-logout { color: var(--accent); }
.account-menu-logout:hover { background: #fff1f3; color: var(--accent); }
.account-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.account-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.account-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-link { color: var(--primary); font-size: 13px; font-weight: 800; white-space: nowrap; }
.seller-link:hover { color: var(--primary-dark); }
.seller-apply { background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 52%, #ecfdf5 100%); min-height: 620px; display: flex; align-items: center; }
.seller-apply-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 500px); gap: 72px; align-items: center; max-width: 1050px; margin: auto; }
.seller-apply-intro { padding: 24px 0; }
.seller-kicker { color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.seller-apply-intro h1 { max-width: 560px; margin: 14px 0 18px; font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: -1.8px; }
.seller-apply-intro > p { max-width: 520px; color: var(--slate); font-size: 17px; line-height: 1.75; }
.seller-benefits { display: grid; gap: 14px; margin-top: 34px; max-width: 440px; }
.seller-benefits div { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: rgba(255,255,255,.72); border: 1px solid rgba(226,232,240,.9); border-radius: 12px; }
.seller-benefits strong { color: var(--primary); font-size: 12px; letter-spacing: .1em; }
.seller-benefits span { font-weight: 700; color: var(--dark); }
.seller-apply-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 34px; box-shadow: 0 20px 55px rgba(15,23,42,.12); }
.seller-apply-card h2 { font-size: 25px; margin-bottom: 8px; }
.seller-apply-card > p { color: var(--slate); margin-bottom: 24px; }
.seller-apply-card .form-group { margin-bottom: 16px; }
.seller-apply-card .form-control { background: #f8fafc; }
.vendor-shop-hero { background-color: #1e293b; background-size: cover; background-position: center; color: #fff; }
.vendor-shop-hero h1, .vendor-shop-hero p { color: #fff; }
.vendor-shop-hero .breadcrumb { color: #cbd5e1; }
.vendor-shop-hero .breadcrumb a { color: #bfdbfe; }
.vendor-shop-identity { display: flex; align-items: center; gap: 18px; }
.vendor-shop-identity img { width: 76px; height: 76px; object-fit: contain; background: #fff; border-radius: 14px; padding: 8px; }
.vendor-portal-bar { padding-top: 18px; padding-bottom: 18px; }
.vendor-portal-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; background: var(--dark); border-radius: 12px; color: #cbd5e1; }
.vendor-portal-nav strong { color: #fff; margin-right: 8px; }
.vendor-portal-nav a { color: #cbd5e1; font-size: 13px; font-weight: 700; }
.vendor-portal-nav a:hover { color: #fff; }
.vendor-portal-nav .vendor-shop-link { color: #bfdbfe; }
.nav-client-mobile { display: none; }
.cart-btn {
    position: relative;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--dark);
    transition: .18s;
}
.cart-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-count {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 21px; height: 21px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 800;
    display: grid; place-items: center;
    border: 2px solid #fff;
}
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none;
    padding: 8px;
}
.nav-toggle span {
    width: 22px; height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: .2s;
}
.nav-cart-mobile { display: none; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, .35), transparent 50%),
        radial-gradient(ellipse at 80% 10%, rgba(79, 70, 229, .4), transparent 45%),
        radial-gradient(ellipse at 70% 90%, rgba(225, 29, 72, .25), transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
    color: #fff;
    padding: 88px 0 96px;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .4;
    pointer-events: none;
}
.hero::before { width: 420px; height: 420px; background: #7c3aed; top: -140px; right: -80px; }
.hero::after { width: 340px; height: 340px; background: #06b6d4; bottom: -160px; left: -60px; }
.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 22px;
    backdrop-filter: blur(6px);
}
.hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.08;
    margin-bottom: 18px;
}
.hero h1 span {
    background: linear-gradient(90deg, #818cf8, #c084fc, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { font-size: 17px; color: rgba(255, 255, 255, .85); max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    transition: .2s;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .4);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-50); }
.btn-favorite-selected { background: #ef4444; color: #fff; border: 1.5px solid #ef4444; }
.btn-favorite-selected:hover { background: #dc2626; border-color: #dc2626; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #1e293b; }
.btn-danger { background: var(--accent); color: #fff; }
.btn-danger:hover { background: #be123c; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Section titles ---------- */
.section { padding: 64px 0; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}
.section-head h2 { font-size: 27px; font-weight: 800; letter-spacing: -.8px; }
.section-head p { color: var(--slate); font-size: 15px; margin-top: 4px; }
.section-head .link-all { color: var(--primary); font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.section-head .link-all:hover { text-decoration: underline; }

/* ---------- Category chips ---------- */
.cat-chips { display: flex; gap: 12px; flex-wrap: wrap; }
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate);
    transition: .18s;
}
.cat-chip:hover, .cat-chip.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-2px);
}

/* ---------- Product grid & cards ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: .25s;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, .3);
}
.product-img-wrap {
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.product-img-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform .35s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.07); }
.product-img-placeholder {
    font-size: 58px;
    filter: grayscale(.15);
}
.badge {
    position: absolute;
    top: 14px; left: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 11px;
    border-radius: 999px;
    letter-spacing: .3px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(225, 29, 72, .35);
}
.badge.sale { background: var(--warning); }
.badge.out { background: var(--slate); }
.product-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.product-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.35;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-name:hover { color: var(--primary); }
.product-price-row { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.price { font-size: 20px; font-weight: 800; color: var(--dark); letter-spacing: -.4px; }
.old-price { font-size: 14px; color: var(--slate-light); text-decoration: line-through; }
.product-actions { display: flex; gap: 10px; margin-top: 14px; }
.add-btn { flex: 1; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 84px;
    right: 20px;
    z-index: 999;
    padding: 15px 20px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 360px;
    animation: slideIn .35s cubic-bezier(.21, 1.02, .73, 1);
}
.toast-success { background: var(--success); }
.toast-error { background: var(--accent); }
.toast-info { background: var(--primary); }
.toast-close {
    background: none; border: none;
    color: #fff; font-size: 20px;
    line-height: 1;
    opacity: .75;
    margin-left: auto;
}
.toast-close:hover { opacity: 1; }
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeUp {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---------- Product detail ---------- */
.pd-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
    min-width: 0;
}
.pd-gallery {
    position: sticky;
    top: 100px;
    width: 100%;
    max-width: 500px;
    min-width: 0;
    margin: 0 auto;
}
.pd-img {
    background: radial-gradient(circle at 50% 38%, #ffffff 0, #f8fafc 58%, #e8eef6 100%);
    border-radius: 16px;
    width: 100%;
    height: 375px;
    display: grid;
    place-items: center;
    padding: 28px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .1), inset 0 0 0 6px rgba(255, 255, 255, .5);
}
.pd-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
    object-fit: contain;
    border-radius: 12px;
    transition: transform .3s ease;
}
.pd-img:hover img { transform: scale(1.025); }
.pd-img .product-img-placeholder { font-size: 120px; }
.pd-thumbnails {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 20px;
    max-width: 100%;
    min-width: 0;
    clear: both;
    position: relative;
    z-index: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-light) transparent;
}
.pd-thumbnails::-webkit-scrollbar { height: 6px; }
.pd-thumbnails::-webkit-scrollbar-thumb { background: var(--slate-light); border-radius: 999px; }
.pd-thumbnails::-webkit-scrollbar-track { background: transparent; }
.pd-thumbnail { flex: 0 0 68px; }
.pd-thumbnail {
    aspect-ratio: 1;
    padding: 6px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    overflow: hidden;
    transition: .18s;
}
.pd-thumbnail:hover,
.pd-thumbnail.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.pd-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.gallery-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gallery-preview img { width: 64px; height: 64px; object-fit: contain; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.pd-cat { color: var(--primary); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.pd-title { font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -1px; margin: 8px 0 14px; line-height: 1.15; }
.pd-price-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.pd-price { font-size: 32px; font-weight: 900; letter-spacing: -1px; }
.pd-old { font-size: 19px; color: var(--slate-light); text-decoration: line-through; }
.pd-save {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.pd-desc { color: var(--slate); font-size: 15.5px; margin-bottom: 24px; white-space: pre-line; }
.pd-meta { display: flex; gap: 24px; margin-bottom: 26px; }
.pd-meta div { font-size: 13.5px; color: var(--slate); }
.pd-meta b { color: var(--dark); font-weight: 700; }
.stock-in { color: var(--success); font-weight: 700; }
.stock-low { color: var(--warning); font-weight: 700; }
.stock-out { color: var(--accent); font-weight: 700; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.qty-label { font-weight: 700; font-size: 14.5px; color: var(--slate); }
.qty-box {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.qty-box button {
    width: 42px; height: 42px;
    background: none; border: none;
    font-size: 20px; font-weight: 700;
    color: var(--dark);
    transition: .15s;
}
.qty-box button:hover { background: var(--primary-50); color: var(--primary); }
.qty-box input {
    width: 52px; height: 42px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    outline: none;
    -moz-appearance: textfield;
}
.qty-box input::-webkit-outer-spin-button,
.qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.product-info-section { scroll-margin-top: 76px; }
.product-summary-description { white-space: pre-line; }
.product-tabs-heading { color: var(--dark); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.product-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.product-tabs button { padding: 12px 18px; color: var(--muted); font: inherit; font-weight: 700; white-space: nowrap; border: 0; border-bottom: 3px solid transparent; background: transparent; cursor: pointer; }
.product-tabs button:hover, .product-tabs button:focus, .product-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.product-tab-panel { display: none; scroll-margin-top: 82px; padding: 8px 0 28px; }
.product-tab-panel.active { display: block; }
.product-tab-panel h2 { margin-bottom: 12px; font-size: 22px; }
.product-tab-panel p { color: var(--muted); line-height: 1.8; }
.product-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-details-grid div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--primary-50); border-radius: 10px; }
.product-details-grid span { color: var(--muted); }
.product-details-grid strong { text-align: right; }
.product-specs-title { margin: 28px 0 12px; font-size: 18px; }
.product-specs-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.product-specs-table div { display: grid; grid-template-columns: minmax(140px, 30%) 1fr; gap: 18px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.product-specs-table div:last-child { border-bottom: 0; }
.product-specs-table div:nth-child(odd) { background: var(--primary-50); }
.product-specs-table span { color: var(--muted); font-weight: 600; }
.product-specs-table strong { white-space: pre-line; }
.product-reviews-panel { padding-top: 20px; }

/* ---------- Cart page ---------- */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}
.cart-list { display: flex; flex-direction: column; gap: 16px; }
.cart-item {
    display: flex;
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    animation: fadeUp .3s ease;
}
.cart-item-img {
    width: 88px; height: 88px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 12px;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.cart-item-img .product-img-placeholder { font-size: 32px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.cart-item-name:hover { color: var(--primary); }
.cart-item-price { color: var(--slate); font-size: 13.5px; }
.cart-item-controls { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.cart-qty { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.cart-qty button {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    font-weight: 800;
    transition: .15s;
}
.cart-qty button:hover { border-color: var(--primary); color: var(--primary); }
.remove-btn {
    background: none; border: none;
    color: var(--slate-light);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    transition: .15s;
}
.remove-btn:hover { color: var(--accent); background: #fef2f2; }
.cart-item-total { font-weight: 800; font-size: 16px; text-align: right; min-width: 90px; }

.cart-summary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    position: sticky;
    top: 96px;
}
.cart-summary h3 { font-size: 19px; font-weight: 800; margin-bottom: 20px; }
.sum-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14.5px; color: var(--slate); }
.sum-row.total { border-top: 2px solid var(--border); margin-top: 10px; padding-top: 16px; color: var(--dark); font-weight: 800; font-size: 18px; }
.sum-row.total span:last-child { color: var(--primary); }
.free-delivery-note {
    background: var(--primary-50);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.empty-state {
    text-align: center;
    padding: 70px 20px;
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-state .emoji { font-size: 56px; margin-bottom: 14px; }
.empty-state h3 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.empty-state p { color: var(--slate); margin-bottom: 24px; }

/* ---------- Checkout ---------- */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 22px;
}
.form-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.form-card h3 .step-num {
    width: 28px; height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 14px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13.5px; font-weight: 700; color: var(--dark); }
.form-group label .req { color: var(--accent); }
.form-control {
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: .15s;
    background: var(--card);
    color: var(--dark);
    width: 100%;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12.5px; color: var(--slate-light); }

.payment-options { display: flex; flex-direction: column; gap: 12px; }
.payment-option {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 15px 16px;
    cursor: pointer;
    transition: .15s;
    position: relative;
}
.payment-option:hover { border-color: var(--primary); }
.payment-option.selected { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.payment-option input { position: absolute; opacity: 0; }
.payment-option .pay-icon { font-size: 26px; }
.payment-option .pay-name { font-weight: 700; font-size: 15px; }
.payment-option .pay-desc { font-size: 12.5px; color: var(--slate); }
.payment-option .radio {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
}
.payment-option.selected .radio { border-color: var(--primary); }
.payment-option.selected .radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--primary);
    border-radius: 50%;
}

.order-summary-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; max-height: 300px; overflow-y: auto; }
.os-item { display: flex; gap: 12px; align-items: center; }
.os-item img { width: 46px; height: 46px; border-radius: 8px; object-fit: contain; background: #f1f5f9; padding: 4px; }
.os-item .os-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.os-item .os-qty { color: var(--slate); font-size: 12.5px; }
.os-item .os-price { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- Success page ---------- */
.success-wrap {
    text-align: center;
    max-width: 560px;
    margin: 40px auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 50px 40px;
    animation: fadeUp .45s ease;
}
.success-icon {
    width: 84px; height: 84px;
    background: #ecfdf5;
    color: var(--success);
    border-radius: 50%;
    display: grid; place-items: center;
    margin: 0 auto 22px;
    font-size: 40px;
    box-shadow: 0 8px 24px rgba(22, 163, 74, .2);
}
.success-wrap h1 { font-size: 28px; font-weight: 900; letter-spacing: -.8px; margin-bottom: 10px; }
.success-wrap .order-no {
    display: inline-block;
    background: var(--primary-50);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 15px;
    padding: 8px 18px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.success-wrap p { color: var(--slate); margin-bottom: 26px; }

/* ---------- Footer ---------- */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    padding: 56px 24px 36px;
}
.footer-col h4 { color: #fff; font-size: 15.5px; font-weight: 800; margin-bottom: 16px; }
.footer-col p { font-size: 14px; line-height: 1.7; max-width: 300px; }
.footer-col a {
    display: block;
    font-size: 14px;
    padding: 5px 0;
    color: #94a3b8;
    transition: .15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--slate); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--slate-light); }

/* ---------- Page header ---------- */
.page-head { padding: 40px 0 24px; }
.page-head h1 { font-size: 30px; font-weight: 900; letter-spacing: -.8px; }
.page-head p { color: var(--slate); margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero { padding: 72px 0 80px; }
    .pd-img { position: relative; }
    .pd-gallery { position: static; max-width: 100%; }
    .pd-img { height: 300px; }
}

@media (max-width: 900px) {
    .pd-wrap, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .seller-apply-grid { grid-template-columns: 1fr; gap: 28px; }
    .seller-apply { display: block; }
    .seller-apply-intro h1 { font-size: 42px; }
    .cart-summary, .order-summary { position: static; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 40px 24px 28px; }
    .form-grid { grid-template-columns: 1fr; }
    .brand-text small { display: none; }
}

@media (max-width: 1100px) {
    .container { padding: 0 16px; }
    .site-header { position: sticky; }
    .header-inner { position: relative; }
    .main-nav {
        position: absolute;
        top: 100%;
        bottom: calc(100% - 100dvh);
        left: 0; right: 0;
        width: min(86vw, 360px);
        background: var(--card);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 12px 16px 18px;
        gap: 4px;
        border-bottom: 1px solid var(--border);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateX(-105%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .24s ease, transform .28s ease, visibility .28s ease;
        z-index: 99;
        overflow-y: auto;
    }
    .main-nav.open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .main-nav a { padding: 12px 14px; border-radius: 10px; }
    .nav-client-mobile { display: block; }
    .nav-toggle { display: flex; }
    .nav-cart-mobile { display: block !important; }
    .header-actions .cart-btn { display: none; }
    .header-actions .seller-link { display: none; }
    .hero { padding: 52px 0 64px; }
    .hero p { font-size: 16px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; }
    .section { padding: 44px 0; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .product-body { padding: 14px; }
    .product-name { font-size: 14px; }
    .price { font-size: 17px; }
    .old-price { font-size: 12px; }
    .product-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .add-btn { padding: 9px 12px; font-size: 12.5px; }
    .toast { right: 16px; left: 16px; max-width: none; }
}

@media (max-width: 480px) {
    .brand-mark { width: 36px; height: 36px; font-size: 15px; }
    .brand-text strong { font-size: 14.5px; }
    .account-label { display: none; }
    .account-link { padding: 4px; }
    .hero h1 { font-size: 30px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-img-wrap { padding: 14px; }
    .product-actions { grid-template-columns: 1fr; }
    .cart-item { flex-wrap: wrap; }
    .cart-item-total { min-width: auto; }
    .pd-actions .btn { flex: 1 1 100%; }
    .success-wrap { padding: 36px 24px; }
}

/* ---------- Guest account actions (modern buttons) ---------- */
.account-guest { display: flex; align-items: center; gap: 8px; }
.guest-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: .18s;
}
.guest-login {
    color: var(--dark);
    background: transparent;
    border: 1.5px solid var(--border);
}
.guest-login:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.guest-register {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}
.guest-register:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79, 70, 229, .4); }
.guest-user-ico { flex-shrink: 0; }

/* ---------- Header polish ---------- */
.site-header { box-shadow: 0 1px 0 rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06); }
.cart-btn { transition: .18s; }
.cart-btn:hover { transform: translateY(-1px); }
.cart-btn svg { transition: transform .18s ease; }
.cart-btn:hover svg { transform: scale(1.08); }
.account-link:focus-visible,
.cart-btn:focus-visible,
.nav-toggle:focus-visible,
.guest-link:focus-visible,
.seller-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 1100px) {
    .header-actions .account-guest { display: none; }
}
